﻿using System.Collections.Generic;
using NUnit.Framework;
using Rhino.Mocks;
using WpfApplication6.Model;

namespace WpfApplication6.ViewModel
{
    [TestFixture]
    public class ProductsViewModelTest
    {
        [Test]
        public void CanInitItemsListTest()
        {
            //arrange
            var repository = MockRepository.GenerateStub<IProductsRepository>();
            repository.Stub(x => x.GetProducts()).Return(new List<ProductItem>
            {
                new ProductItem()
            });

            //act
            var viewmodel = new ProductsViewModel(repository);

            //assert
            Assert.IsTrue(viewmodel.ItemsList.Count == 1);
        }
    }
}